package com.rabbiter.fm.controller;

import com.rabbiter.fm.service.DataAnalysisService;
import com.rabbiter.fm.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("data-analysis")
public class DataAnalysisController {

    @Autowired
    private DataAnalysisService dataAnalysisService;

    /**
     * 返回数据分析接口，调用服务层获取数据
     * @return
     */
    @GetMapping("stats")
    public ResultVo getDataAnalysis() {
        // 从 DataAnalysisService 获取分析数据
        return ResultVo.success(dataAnalysisService.getDataAnalysis());
    }
}
